Uec3.QueryCompanyServiceWindow = Ext.extend(Ext.app.Module,{
	id: 'queryCompanyService',
   /*
    * Initialize this module.
    * This function is called at startup (page load/refresh).
    */
   init : function(initParams){
   
   },
  
   getComponent:function(){
   	
   	    var companyService_store = new Ext.data.JsonStore({
   	          url:Uec3.App.Constants.homeUrl + '/companyPackage/queryCompanyService.do',
   	          root:'items',
   	          totalProperty:'total',
   	          autoLoad:true,
   	          baseParams:{start:0,limit:10},
   	          fields:['serviceName',{name:'gmtBegin',type:'date',dateFormat:'Y-m-d H:i:s'},{name:'gmtEnd',type:'date',dateFormat:'Y-m-d H:i:s'}]
   	         /* listeners:{
   	            'beforeload':function(){
                    Ext.MessageBox.wait("正在加载数据...","提示");
                 }
   	          }*/
   	    });
   	
   	    var selModel = new Ext.grid.RowSelectionModel({
   	           moveEditorOnEnter:true,
   	           singleSelect :true
   	    });
   	    
   	    var colModel = new Ext.grid.ColumnModel({
   	         columns:[
          		   	new Ext.grid.RowNumberer(),        		   	
      		 	   	{header:'服务名称',dataIndex:'serviceName',width:120},
      		 		{header:'有效开始时间',dataIndex:'gmtBegin',renderer:Ext.util.Format.dateRenderer('Y-m-d')},
      		 		{header:'有效结束时间',dataIndex:'gmtEnd',renderer:Ext.util.Format.dateRenderer('Y-m-d')}
          		],
          		defaults: {
          			menuDisabled: true         
       			}
   	    });
   	    
   		var companyService_grid = new Ext.grid.GridPanel({
   		     viewConfig:{forceFit:true,scrollOffset:20},	   	   
	   	   	 autoScroll : true,
	   	   	 loadMask:{mag:'公司服务列表加载中,请稍后....'},
	   	   	 titleCollapse:true,
	         colModel:colModel,
	         height:250,
	         selModel:selModel,
	         store:companyService_store,	           
	         columnLines :true,
	         bbar: new Ext.PagingToolbar({
		            pageSize:10,
	                store:companyService_store,
	                displayInfo: true,
	                displayMsg: '第 {0} - {1} 条  共 {2} 条',
                    emptyMsg: "没有记录",                   
                    listeners:{
                        beforechange:function(){
                      		 Ext.MessageBox.wait("正在加载公司服务列表...","提示");	                     
                        },
                        change:function(){
                            Ext.MessageBox.hide();
                        }
                    }
		     }) 
   		});
   		
   		return companyService_grid;
   },
   
   /**
	* Create this modules window here.
	*/
   createWindow : function(){
    	var desktop = this.app.getDesktop();
        var win = desktop.getWindow('queryCompanyServiceWindow');
        if (!win) {
			win = desktop.createWindow({
				        id : "queryCompanyServiceWindow",
						title : '公司订购服务查询',
						width : 500,
						height : 500,
						iconCls : 'acc-icon',
					    minWidth:1000,
						maximizable : false,
						resizable:false,
						maximized:false,
						//autoScroll : true,
						constrainHeader : true,
						taskbuttonTooltip : "公司订购服务查询",
						layout : "fit",
						items : [this.getComponent()]
					});
		}		
    	win.show();         
   }
});